1
|
|
|
/** global: List */ |
2
|
|
|
|
3
|
|
|
var listjs = (function() { |
4
|
|
|
|
5
|
|
|
function defaultList(id, names) { |
6
|
|
|
var list = new List(id, { |
7
|
|
|
valueNames: names, |
8
|
|
|
sortFunction: function(a, b, options) { |
9
|
|
|
// strip HTML tags and commas |
10
|
|
|
return list.utils.naturalSort(a.values()[options.valueName].replace(/<.*?>|,/g, ''), b.values()[options.valueName].replace(/<.*?>|,/g, ''), options); |
11
|
|
|
} |
12
|
|
|
}); |
13
|
|
|
} |
14
|
|
|
|
15
|
|
|
var listjs = {}; |
16
|
|
|
|
17
|
|
|
listjs.PlanetList = function() { |
18
|
|
|
defaultList('planet-list', ['sort_name', 'sort_lvl', 'sort_owner', 'sort_sector', 'sort_build']); |
19
|
|
|
}; |
20
|
|
|
|
21
|
|
|
listjs.PlanetListFinancial = function() { |
22
|
|
|
defaultList('planet-list', ['sort_name', 'sort_lvl', 'sort_owner', 'sort_sector', 'sort_credits', 'sort_bonds', 'sort_interest', 'sort_mature']); |
23
|
|
|
}; |
24
|
|
|
|
25
|
|
|
listjs.alliance_forces = function() { |
26
|
|
|
defaultList('forces-list', ['sort_name', 'sort_sector', 'sort_cds', 'sort_sds', 'sort_mines', {name: 'sort_expire', attr: 'data-expire'}]); |
27
|
|
|
}; |
28
|
|
|
|
29
|
|
|
listjs.alliance_list = function() { |
30
|
|
|
defaultList('alliance-list', ['sort_recruit', 'sort_name', 'sort_totExp', 'sort_avgExp', 'sort_members']); |
31
|
|
|
}; |
32
|
|
|
|
33
|
|
|
listjs.alliance_message = function() { |
34
|
|
|
defaultList('topic-list', ['sort_topic', 'sort_author', 'sort_replies', {name: 'sort_lastReply', attr: 'data-lastReply'}]); |
35
|
|
|
}; |
36
|
|
|
|
37
|
|
|
listjs.alliance_roster = function() { |
38
|
|
|
defaultList('alliance-roster', [{name: 'sort_name', attr: 'data-name'}, 'sort_race', 'sort_experience', 'sort_role', 'sort_status']); |
39
|
|
|
}; |
40
|
|
|
|
41
|
|
|
listjs.combat_log_list = function() { |
42
|
|
|
defaultList('logs-list', ['sort_date', 'sort_sectorid', 'sort_attacker', 'sort_defender']); |
43
|
|
|
}; |
44
|
|
|
|
45
|
|
|
listjs.council_list = function() { |
46
|
|
|
defaultList('council-members', [{name: 'sort_name', attr: 'data-name'}, 'sort_alliance', 'sort_experience']); |
47
|
|
|
}; |
48
|
|
|
|
49
|
|
|
listjs.current_players = function() { |
50
|
|
|
defaultList('cpl', [{name: 'sort_name', attr: 'data-name'}, 'sort_race', 'sort_alliance', 'sort_exp']); |
51
|
|
|
}; |
52
|
|
|
|
53
|
|
|
listjs.forces_list = function() { |
54
|
|
|
defaultList('forces-list', ['sort_sector', 'sort_cds', 'sort_sds', 'sort_mines', {name: 'sort_expire', attr: 'data-expire'}]); |
55
|
|
|
}; |
56
|
|
|
|
57
|
|
|
listjs.message_box = function() { |
58
|
|
|
defaultList('folders', ['sort_name', 'sort_messages']); |
59
|
|
|
}; |
60
|
|
|
|
61
|
|
|
listjs.shop_weapon = function() { |
62
|
|
|
defaultList('weapon-list', ['sort_name', 'sort_shield', 'sort_armor', 'sort_acc', 'sort_race', 'sort_power', 'sort_cost']); |
63
|
|
|
}; |
64
|
|
|
|
65
|
|
|
listjs.alliance_pick = function() { |
66
|
|
|
defaultList('draft-pick', ['sort_name', 'sort_race', 'sort_hof', 'sort_score']); |
67
|
|
|
}; |
68
|
|
|
|
69
|
|
|
return listjs; |
70
|
|
|
|
71
|
|
|
})(); |
72
|
|
|
|